<template>
  <div class="ku-gou-music">
    <div class="nav-list">
      <dl>
        <dt>发现音乐</dt>
        <dd v-for="item in navList" :key="item.name">
          <i class="iconfont wos-music" />
          <span class="ml10">{{ item.name }}</span>
        </dd>
      </dl>
    </div>
    <div class="music-content">
      <div class="banner">
        <div class="banner-left">
          <img src="@/assets/images/kuGou/banner02.jpg" alt="banner" />
        </div>
        <div class="banner-right">
          <img src="@/assets/images/kuGou/banner03.jpg" alt="banner" />
        </div>
      </div>
      <ul class="like">
        <li>猜你喜欢</li>
        <li>每日推荐</li>
        <li>排行榜</li>
        <li>分类</li>
      </ul>
      <dl class="song-list">
        <dt>今日专属推荐</dt>
        <dd v-for="item in 20" :key="item">
          <img src="@/assets/images/kuGou/banner01.jpg" alt="song" />
          <p>今日推荐</p>
        </dd>
      </dl>
    </div>
  </div>
</template>

<script setup lang="ts">
import { reactive } from 'vue'

// 导航列表
const navList = reactive([
  { name: '为你推荐' },
  { name: '乐库' },
  { name: '歌单' },
  { name: '频道' },
  { name: '视频' },
  { name: '直播' }
])
</script>

<style scoped lang="scss">
.ku-gou-music {
  width: 100%;
  height: 100%;
  display: flex;
  overflow-y: auto;
  color: var(--font-checked-color);

  .nav-list {
    width: 180px;

    dl {
      padding: 0 10px;

      dt {
        padding-bottom: 10px;
      }

      dd {
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        padding-left: 20px;
        height: 30px;
        border-radius: 4px;
        transition: color 0.3s;

        &:hover,
        &.checked {
          background-color: var(--nav-list-checked);
        }
      }
    }
  }

  .music-content {
    width: calc(100% - 180px);
    padding: 0 20px;
    box-sizing: border-box;

    .banner {
      width: 100%;
      display: flex;
      align-items: center;

      .banner-left {
        width: 500px;
        height: 190px;
        margin-right: 20px;
        display: flex;
        border-radius: 8px;
        position: relative;
        overflow: hidden;

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          object-position: center center;
        }
      }

      .banner-right {
        width: 500px;
        height: 190px;

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          object-position: center center;
        }
      }
    }
  }

  .like {
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    > li {
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 16px;
      border-radius: 6px;
      width: calc((100% - 60px) / 4);
      height: 50px;
      background: linear-gradient(90deg, rgb(255, 182, 182), rgb(255, 127, 157));

      &:nth-of-type(2) {
        background: linear-gradient(90deg, rgb(121, 220, 248), rgb(74, 176, 250));
      }

      &:nth-of-type(3) {
        background: linear-gradient(90deg, rgb(235, 187, 237), rgb(180, 130, 243));
      }

      &:nth-of-type(4) {
        background: linear-gradient(90deg, rgb(158, 228, 215), rgb(75, 216, 220));
      }
    }
  }

  .song-list {
    width: fit-content;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;

    dt {
      padding-top: 30px;
      padding-bottom: 20px;
      font-size: 16px;
      width: 100%;
    }

    dd {
      display: flex;
      flex-direction: column;
      margin-right: 20px;

      img {
        border-radius: 6px;
        width: 200px;
        height: 200px;
        object-fit: cover;
      }

      p {
        padding: 10px 0;
        font-size: 14px;
        height: 40px;
      }
    }
  }
}
</style>
